package com.mxsat.common.enums.dict;

import com.mxsat.common.enums.EnumDictionaryItem;

public enum DataStatusEnum implements EnumDictionaryItem<DataStatusEnum> {
	正常("N", "正常"), 删除("N", "删除");
	
	private static final String ENUM_NAME = "数据状态标识";
	private static final String ENUM_CODE = "DATA_STATUS";

	private String code;
	private String name;

	DataStatusEnum(String code, String name) {
		this.code = code;
		this.name = name;
	}

	@Override
	public String toCode() {
		return code;
	}

	@Override
	public String toName() {
		return name;
	}

	@Override
	public String getEnumName() {
		return ENUM_NAME;
	}

	@Override
	public String getEnumCode() {
		return ENUM_CODE;
	}

	@Override
	public DataStatusEnum parseByCode(String code) {
		for (DataStatusEnum item : DataStatusEnum.values()) {
			if (item.toCode().equals(code))
				return item;
		}
		return null;
	}

	@Override
	public DataStatusEnum parseByName(String name) {
		for (DataStatusEnum item : DataStatusEnum.values()) {
			if (item.toName().equals(name)) {
				return item;
			}
		}
		return null;
	}

}
